apiVersion: v1
data:
  kubesphere.yaml: |

    ldap:
      host: openldap.kubesphere-system.svc:389
      managerDN: cn=admin,dc=kubesphere,dc=io
      managerPassword: admin
      userSearchBase: ou=Users,dc=kubesphere,dc=io
      groupSearchBase: ou=Groups,dc=kubesphere,dc=io
    redis:
      host: redis.kubesphere-system.svc
      port: 6379
      password: ""
      db: 0
{% if devops.enabled or openpitrix.enabled %}
    s3:
      endpoint: http://minio.kubesphere-system.svc:9000
      region: us-east-1
      disableSSL: true
      forcePathStyle: true
      accessKeyID: openpitrixminioaccesskey
      secretAccessKey: openpitrixminiosecretkey
      bucket: s2i-binaries
{% endif %}
{% if devops.enabled or openpitrix.enabled or notification.enabled or alerting.enabled %}
    mysql:
      host: mysql.kubesphere-system.svc:3306
      username: root
      password: password
      maxIdleConnections: 100
      maxOpenConnections: 100
      maxConnectionLifeTime: 10s
{% endif %}

{% if devops.enabled is defined and devops.enabled == true %}
    devops:
      host: http://ks-jenkins.kubesphere-devops-system.svc/
      username: admin
      password: {{ ks_token_str }}
      maxConnections: 100
{% if externalSonarUrl is defined and externalSonarToken is defined %}
    sonarQube:
      host: {{ externalSonarUrl }}
      token: {{ externalSonarToken }}
{% endif %}
{% endif %}

{% if servicemesh.enabled is defined and servicemesh.enabled == true %}
    servicemesh:
      istioPilotHost: http://istio-pilot.istio-system.svc:8080/version
      jaegerQueryHost: http://jaeger-query.istio-system.svc:16686
      servicemeshPrometheusHost: http://prometheus-k8s-system.kubesphere-monitoring-system.svc:9090
{% endif %}

{% if openpitrix.enabled is defined and openpitrix.enabled == true %}
    openpitrix:
      runtimeManagerEndpoint:    "openpitrix-runtime-manager.openpitrix-system.svc:9103"
      clusterManagerEndpoint:    "openpitrix-cluster-manager.openpitrix-system.svc:9104"
      repoManagerEndpoint:       "openpitrix-repo-manager.openpitrix-system.svc:9101"
      appManagerEndpoint:        "openpitrix-app-manager.openpitrix-system.svc:9102"
      categoryManagerEndpoint:   "openpitrix-category-manager.openpitrix-system.svc:9113"
      attachmentManagerEndpoint: "openpitrix-attachment-manager.openpitrix-system.svc:9122"
      repoIndexerEndpoint:       "openpitrix-repo-indexer.openpitrix-system.svc:9108"
{% endif %}

    monitoring:
      endpoint: http://prometheus-k8s.kubesphere-monitoring-system.svc:9090
      secondaryEndpoint: http://prometheus-k8s-system.kubesphere-monitoring-system.svc:9090

{% if logging.enabled is defined and logging.enabled == true %}
    logging:
{% if logging.externalElasticsearchUrl is defined and logging.externalElasticsearchPort is defined %}
      host: http://{{ logging.externalElasticsearchUrl }}:{{ logging.externalElasticsearchPort }}
{% else %}
      host: http://elasticsearch-logging-data.kubesphere-logging-system.svc.cluster.local:9200
{% endif %}
      indexPrefix: ks-{{ logging.elkPrefix }}-log
{% endif %}

{% if alerting.enabled is defined and alerting.enabled == true %}
    alerting:
      endpoint: http://alerting.kubesphere-alerting-system.svc
{% endif %}

{% if notification.enabled is defined and notification.enabled == true %}
    notification:
      endpoint: http://notification.kubesphere-alerting-system.svc
{% endif %}

kind: ConfigMap
metadata:
  name: kubesphere-config
  namespace: kubesphere-system